$(()=>{
    //渲染出生日期
    layui.use(function () {
        const laydate = layui.laydate;
        laydate.render({
            elem: "#dateTime",
            type: "date"
        });
    });
})
function submitAddMovie(cb=$.noop){
    let name=$("#name").val();
    let actor=$("#actor").val();
    let rating=$("#rating").val();
    let movieTime=$("#movieTime").val();
    let dateTime=$("#dateTime").val();
    let money=$("#money").val();
    // console.log(cardId,name,sex,phone,pinyin,weixin)
    if (name.trim()===""){
        layer.msg("请输入电影名称");
        return;
    }
    if (actor.trim()===""){
        layer.msg("请输入主演");
    }
    //可以继续判断手机号、出生日日期的格式
    $.ajax({
        url:ctx+"/movie/add",
        method:"POST",
        data:{
            name,
            actor,
            rating,
            movieTime,
            dateTime,
            money,
        },
        success:function(data){
          cb(data.success)
        }
    })

}